﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanlyDanhsachThiCapPhong
{
    public partial class frmGhichu : Form
    {
        private string sid;
        public frmGhichu(string sid)
        {
            InitializeComponent();
            this.sid = sid;
        }
        public frmGhichu()
        {
            InitializeComponent();
        }

        private void frmGhichu_Load(object sender, EventArgs e)
        {
            HocSinh hs = new HocSinh();
            hs.Directory = "C:\\Database\\Data.dat";
            try
            {
                hs = hs.getStudentById(sid);
                txtSBD.Text = hs.Sobaodanh;
                txtTen.Text = hs.Hodem + " " + hs.Ten;
                cbbMonthi.Text = hs.Monthi;
            }
            catch (Exception ex)
            { MessageBox.Show(ex.ToString()); }
        }

        private void btTrove_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btNhap_Click(object sender, EventArgs e)
        {
            HocSinh hs = new HocSinh();
            hs.Directory = "C:\\Database\\Data.dat";
            try
            {
                hs.NhapGhiChu(sid, rtxtGhiChu.Text);
                this.Close();
            }
            catch (Exception ex) { }
        }
    }
}
